import request from "@Utils/webServerRequest"

// 获取运费模板
export const getTestApiss = (data) => {
  return request({
    url: `web/coupons/v1/list`,
    method: "get",
    paramete: {
      page: data.page || 1,
      pageSize: data.pageSize || data.page_size || data.size || 100,
      _bid: "ffa_order",
      r: data.r
    }
  })
}
// 登录获取JWT
export const loginGetJwt = (data) => {
  return request({
    url: `api/user/shopLogin`,
    method: "get",
    paramete: {
      shop_id: data.shop_id,
      shop_phone: data.shop_phone
    }
  })
}


// 检查获取手机号情况
export const checkGetPhone = (data) => {
  return request({
    url: `api/user/checkUserPhone`,
    method: "get",
    paramete: {
      shop_id: data.shop_id
    }
  })
}

// 保存手机号
export const saveUserPhone = (data) => {
  return request({
    url: `api/user/saveUserPhone`,
    method: "get",
    paramete: {
      shop_id: data.shop_id,
      shop_phone: data.shop_phone || '',
      user_phone: data.user_phone || ''
    }
  })
}

// 检查代理存在情况
export const cheackUserProxyApi = (data) => {
  return request({
    url: `dlyadminapi/link/cheackUserProxy`,
    method: "get",
    paramete: {
      shopId: data.shopId,
      uuId: data.uuId || '',
      channelCode: data.channelCode
    }
  })
}

// 获取边框 图标
export const getMateriallistAdmin = (data) => {
  return request({
    url: `api/material/marketingList`,
    method: "get",
    paramete: {
      type: data.type || 1,
      page: data.page || 1,
      pageSize: data.pageSize || 20
    }
  })
}

// 获取验证码
export const getVerifyCode = (data) => {
  return request({
    url: `api/dlyuser/code`,
    method: "get",
    paramete: {
      phone: data.phone
    }
  })
}

// 登陆
export const loginApi = (data) => {
  return request({
    url: `api/dlyuser/creted`,
    method: "post",
    paramete: {

    },
    data: {
      phone: data.phone,
      code: data.code
    },
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
export const bindinfo = (data) => {
  return request({
    url: `api/dlyuser/bindinfo`,
    method: "get",
    paramete: {

    }
  })
}

export const getDlyUserInfo = (data) => {
  return request({
    url: `api/dlyuser/userinfo`,
    method: "get",
    jwt: localStorage.getItem(`dlyUserToken`),
    paramete: {

    }
  })
}

// 修改短信配置
export const setUserInfoData = (data) => {
  return request({
    url: `api/dlyuser/setUserInfoData`,
    method: "post",
    jwt: localStorage.getItem(`dlyUserToken`),
    paramete: {

    },
    data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}


// 提交购买短信订单

export const buySmsNums = (data) => {
  return request({
    url: `api/dlyuser/buySmsNums`,
    method: "post",
    jwt: localStorage.getItem(`dlyUserToken`),
    paramete: {},
    data,
    headers: { 'Content-Type': 'application/json' }
  })
}

// 查询支付订单结果
export const queryPayOrder = (paramete) => {
  return request({
    url: `api/alipay/payResult`,
    method: "get",
    jwt: localStorage.getItem(`dlyUserToken`),
    paramete,
    headers: { 'Content-Type': 'application/json' }
  })
}
// 获取用户订单自动设置优惠功能信息
export const getBuyCounpStatus = (data) => {
  return request({
    url: `/api/dlyuser/getBuyCounpStatus`,
    method: "get",
    jwt: localStorage.getItem(`dlyUserToken`),
    paramete: {}
  })
}